package com.lhb.mvnbook.account.captcha;

import java.util.Random;

public class RandomGenerator {
    private static String range = "0123456789abcdefghijklmnopqrstuvwxyz";

    public static synchronized String getRandomString() {
        Random random = new Random();
        StringBuilder buffer = new StringBuilder();
        for ( int i=0; i < 8; i++) {
            buffer.append(range.charAt(random.nextInt(range.length())));
        }
        return buffer.toString();
    }
}
